#!/bin/bash

rm -r $2
mkdir $2
exec  $1 >> $2/output.txt &

while ps u -C "java" >> $2/"log_ps.txt"
do
    mpstat >> $2/log_mpstat.txt
    sleep 0.1
done